package airBattle
{
/**
 * @author daichangxin
 */
public class AirContext
{
	private var _state:IAirState;
	
	private var _moveState:IAirState;
	private var _idleState:IAirState;
	private var _deathState:IAirState;
	private var _attackState:IAirState;
	private var _attackedState:IAirState;
	
	public function AirContext()
	{
		_moveState = new MoveState(this);
		_idleState = new IdleState(this);
		_deathState = new DeathState(this);
		_attackState = new AttackState(this);
		_attackedState = new AttackedState(this);
		
		_state = _idleState;
	}
	
	public function idle():void
	{
		_state.idle();
	}
	
	public function attack():void
	{
		_state.attack();
	}
	
	public function move():void
	{
		_state.move();
	}
	
	public function attacked():void
	{
		_state.attacked();
	}
	
	public function death():void
	{
		_state.death();
	}
	
	//Getter And Setter 
	
	public function setState(state:IAirState):void
	{
		_state = state;
	}
	
	public function getIdleState():IAirState
	{
		return _idleState;
	}
	
	public function getMoveState():IAirState
	{
		return _moveState;
	}
	
	public function getDeathState():IAirState
	{
		return _deathState;
	}
	
	public function getAttackState():IAirState
	{
		return _attackState;
	}
	
	public function getAttackedState():IAirState
	{
		return _attackedState;
	}
	
	public function get state():IAirState
	{
		return _state;
	}
}
}
